// import user from "@/store/user";

export default {
  state: {
    SelectedDataset: '',
    AllNodes: [
      {
        id: 1,
        nodeName: '节点A',
        infectionIntensity: 0.8,
        riskProbability: 0.6,
        riskImportance: 0.75,
        importance: 0.8,
      },
      {
        id: 2,
        nodeName: '节点B',
        infectionIntensity: 0.5,
        riskProbability: 0.4,
        riskImportance: 0.65,
        importance: 0.7,
      },
      {
        id: 3,
        nodeName: '节点C',
        infectionIntensity: 0.9,
        riskProbability: 0.7,
        riskImportance: 0.85,
        importance: 0.9,
      },
      {
        id: 4,
        nodeName: '节点D',
        infectionIntensity: 0.7,
        riskProbability: 0.5,
        riskImportance: 0.8,
        importance: 0.85,
      },
      {
        id: 5,
        nodeName: '节点E',
        infectionIntensity: 0.6,
        riskProbability: 0.3,
        riskImportance: 0.7,
        importance: 0.8,
      },
      {
        id: 6,
        nodeName: '节点F',
        infectionIntensity: 0.4,
        riskProbability: 0.2,
        riskImportance: 0.6,
        importance: 0.4,
      },
      {
        id: 7,
        nodeName: '节点G',
        infectionIntensity: 0.3,
        riskProbability: 0.1,
        riskImportance: 0.5,
        importance: 0.3,
      },
      {
        id: 8,
        nodeName: '节点H',
        infectionIntensity: 0.2,
        riskProbability: 0.05,
        riskImportance: 0.4,
        importance: 0.2,
      },
      {
        id: 9,
        nodeName: '节点I',
        infectionIntensity: 0.1,
        riskProbability: 0.01,
        riskImportance: 0.3,
        importance: 0.1,
      },
      {
        id: 10,
        nodeName: '节点J',
        infectionIntensity: 0.05,
        riskProbability: 0.005,
        riskImportance: 0.2,
        importance: 0.05,
      },
      {
        id: 11,
        nodeName: '节点K',
        infectionIntensity: 0.01,
        riskProbability: 0.001,
        riskImportance: 0.1,
        importance: 0.01,
      },
    ],
    AllEdges: [
      {
        from: 1,
        to: 2,
      },
      {
        from: 2,
        to: 3,
      },
      {
        from: 3,
        to: 4,
      },
      {
        from: 4,
        to: 5,
      },
      {
        from: 1,
        to: 5,
      },
      {
        from: 1,
        to: 3,
      },
      {
        from: 5,
        to: 3,
      },
      {
        from: 5,
        to: 6,
      },
      {
        from: 6,
        to: 7,
      },
      {
        from: 7,
        to: 8,
      },
      {
        from: 8,
        to: 9,
      },
      {
        from: 9,
        to: 10,
      },
      {
        from: 10,
        to: 11,
      },
    ],
  },
  mutations: {
    //修改数据集
    changeDataset(state, dataset) {
      console.log('changeDataset', dataset)
      state.SelectedDataset = dataset
    },
    // 修改所有节点
    changeAllNodes(state, nodes) {
      console.log('changeAllNodes', nodes)
      state.AllNodes = nodes
    },
    // 修改所有边
    changeAllEdges(state, edges) {
      console.log('changeAllEdges', edges)
      state.AllEdges = edges
    },
  },
  getters: {
    // 获取数据集
    getDataset(state) {
      return state.SelectedDataset
    },
    // 获取所有节点
    getAllNodes(state) {
      return state.AllNodes
    },
    // 获取所有边
    getAllEdges(state) {
      return state.AllEdges
    },
  },
}
